const useAppStore = defineStore('app', {
  state: () => ({
    title: 'Vue学习',
    author: '长舞',
    version: 1,
    count: 0
  }),
  getters: {
    /**
     * title
     */
    setTitle: (state) => {
      return (title) => (state.title = title)
    },
    setAuthor: (state) => {
      return (author) => (state.author = author)
    },
    addVersion: (state) => state.version++,
    addCount: (state) => {
      return (payload) => (state.count += payload.amount)
    }
  },
  actions: {
    addActionVersion(version) {
      this.version += version
    }
  }
})
export default useAppStore
